<html>
<head><meta charset="utf-8"><title>fingerprint questions · t-compiler/wg-incr-comp · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/index.html">t-compiler/wg-incr-comp</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html">fingerprint questions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229013500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229013500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229013500">(Mar 05 2021 at 19:47)</a>:</h4>
<p>Is anyone around who might be able to answer random Q's about the Fingerprint abstraction? <span class="user-mention" data-user-id="248906">@cjgillot</span> or maybe <span class="user-mention" data-user-id="124287">@mw</span> ?</p>



<a name="229013570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229013570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229013570">(Mar 05 2021 at 19:47)</a>:</h4>
<p>Context: while reviewing PR <a href="https://github.com/rust-lang/rust/issues/81635">#81635</a>, I decided to see how the <code>to_smaller_hash</code> and <code>from_smaller_hash</code> methods are used</p>



<a name="229014318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229014318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229014318">(Mar 05 2021 at 19:53)</a>:</h4>
<p>actually I think I answered my most immediate question.</p>



<a name="229014547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229014547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229014547">(Mar 05 2021 at 19:55)</a>:</h4>
<p>(I was concerned that <code>HirId::to_fingerprint</code> might be using an unstable value as part of its input, but I then realized that the <code>local_id</code> is in fact stable between compiles (because it is <em>item local</em>, not compilation local...)</p>



<a name="229017002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017002">(Mar 05 2021 at 20:11)</a>:</h4>
<p>What is your question <span class="user-mention" data-user-id="116083">@pnkfelix</span> ?</p>



<a name="229017047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017047">(Mar 05 2021 at 20:11)</a>:</h4>
<p>I guess I don't have one anymore</p>



<a name="229017176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017176">(Mar 05 2021 at 20:12)</a>:</h4>
<p>All for the best!</p>



<a name="229017271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017271">(Mar 05 2021 at 20:13)</a>:</h4>
<p>I posted a note on PR <a href="https://github.com/rust-lang/rust/issues/81635">#81635</a> about an aspect of its change that might have been a concern, where the old code had a property that from_smaller_hash composed with to_smaller_hash yields the original input</p>



<a name="229017307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017307">(Mar 05 2021 at 20:13)</a>:</h4>
<p>and the new code doesn't observe that property</p>



<a name="229017338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017338">(Mar 05 2021 at 20:13)</a>:</h4>
<p>but I don't think anyone needs it here. Its just potentially surprising that the relationship doesn't hold, given the names.</p>



<a name="229017517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229017517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229017517">(Mar 05 2021 at 20:14)</a>:</h4>
<p>(I also have been idly wondering whether an OIBIT to track things that are stable across compilations and things that are known to be unstable across compilations could be of use...)</p>



<a name="229018567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229018567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229018567">(Mar 05 2021 at 20:21)</a>:</h4>
<p>This is pretty much the point of HashStable, isn't is?</p>



<a name="229018707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229018707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cjgillot <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229018707">(Mar 05 2021 at 20:22)</a>:</h4>
<p><code>from_smaller_hash</code> may be better replaced by a call to <code>hash_stable</code> to avoid having this kind of expectation.</p>



<a name="229331440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229331440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229331440">(Mar 08 2021 at 16:37)</a>:</h4>
<p>That's an interesting observation about <code>from_smaller_hash</code> and <code>to_smaller_hash</code>. The two methods were created independently of each other, I think, and the previous symmetry of the two methods definitely was never intended by me. Maybe it would be a good idea to rename them or try get rid of them.</p>



<a name="229362979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229362979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229362979">(Mar 08 2021 at 19:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="248906">cjgillot</span> <a href="#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/fingerprint.20questions/near/229018567">said</a>:</p>
<blockquote>
<p>This is pretty much the point of HashStable, isn't is?</p>
</blockquote>
<p>yes, but, <code>HashStable</code> is not an OIBIT, right?</p>



<a name="229456006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint%20questions/near/229456006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/241847-t-compiler/wg-incr-comp/topic/fingerprint.20questions.html#229456006">(Mar 09 2021 at 10:40)</a>:</h4>
<p>It's not an OIBIT, no.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>